home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / dvi2lj.lha / specs.pro < prev    next >
Encoding:
Text File  |  1995-02-14  |  1.7 KB  |  56 lines

  1. %%----------------------------------------------------------------------
  2. %% 
  3. %%   specs.pro - interpret a few commands out of dvips special 
  4. %%
  5. %%   Peter A. Henning, February 1995
  6. %%
  7. %%----------------------------------------------------------------------
  8. %%%%%%%%%%%%%%%%%%%% usage: program should write 2 small tmpfiles:
  9. %%         @beginspecial
  10. %%         50 @hscale 50 @vscale 
  11. %%         100 @hoffset 150 @voffset
  12. %%         37 @angle
  13. %%         60 @hsize 70 @vsize    (optional, clipping)
  14. %%         @setspecial
  15. %%
  16. %%         @endspecial
  17. %%%%%%%%%%%%%%%%%%%%  set up the special dictionary
  18. /SDict 200 dict def SDict begin 
  19. %%-- defaults values for clipping, offset, scaling, angle
  20. /@SpecialDefaults{/hs 612 def /vs 792 def /ho 0 def /vo 0 def 
  21.                   /hsc 1 def /vsc 1 def /ang 0 def /CLIP 0 def}bind def 
  22. %%-- scaling procedure (complicated, but compatible with dvips)
  23. /@scaleunit 100 def 
  24. /@hscale{@scaleunit div /hsc exch def}bind def
  25. /@vscale{@scaleunit div /vsc exch def}bind def
  26. %%-- clipping procedures
  27. /@hsize{/hs exch def /CLIP 1 def}bind def
  28. /@vsize{/vs exch def /CLIP 1 def}bind def
  29. %%-- offset procedures
  30. /@hoffset{/ho exch def}bind def
  31. /@voffset{/vo exch def}bind def
  32. %%-- rotation procedures 
  33. /@angle{/ang exch def}bind def
  34. end
  35. %%%%%%%%%%%%%%%%%%%% start/end using the dictionary
  36. /@beginspecial{SDict begin gsave @SpecialDefaults }def 
  37. /@endspecial{grestore save restore end}def
  38. %%%%%%%%%%%%%%%%%%%% do all the stuff defined above
  39. /@setspecial{
  40. %%-- clipping if hsize/vsize has been used
  41. CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto
  42.           closepath clip}if
  43. %%-- offset, scaling, rotation
  44. ho vo translate hsc vsc scale ang rotate 
  45. %%-- some safeguards
  46. /showpage{}def /erasepage{}def /copypage{}def newpath
  47. }def 
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.